%ol.breadcrumb
  %li
    %i.fa.fa-dashboard.fa-prl5
    = link_to admin_root_path do
      管理首页
  %li.active
    %i.fa.fa-book.fa-prl5
    文章管理
#admin-post-index
  .table-responsive
    %table.table.table-bordered.table-hover.table-striped
      %thead
        %tr
          %th 文章名
          %th 所属分类
          %th 标签
          %th 状态
          %th 评论数
          %th 创建时间
          %th 操作
      %tbody
        - @posts.each do |p|
          %tr{class: "post-#{p.id}"}
            %td
              = link_to p.title, edit_admin_post_path(p)
            %td
              = p.column.name rescue '无'
            %td.tags-cell
              - p.tags.each do |t|
                = link_to t do
                  %span.label.label-default.label-mr5
                    = t.name
            %td
              = ::Post::POST_TYPE[p.status]
            %td
              = p.comments.count rescue 0
            %td
              = p.created_at.localtime.strftime("%x %H:%M")
            %td
              = link_to edit_admin_post_path(p), class: 'has-tooltip operation-fa-pr3', 'data-original-title' => '编辑文章', 'data-placement' => 'top', 'data-toggle' => 'tooltip' do
                .fa.fa-pencil-square
              = link_to admin_post_path(p), method: :delete, class: 'has-tooltip operation-fa-pr3', 'data-original-title' => '删除文章', 'data-placement' => 'top', 'data-toggle' => 'tooltip', 'data-confirm' => '删除文章不可恢复，确定要删除？', remote: true do
                .fa.fa-trash
              = link_to p, class: 'has-tooltip operation-fa-pr3', 'data-original-title' => '查看文章', 'data-placement' => 'top', 'data-toggle' => 'tooltip', target: '_blank' do
                .fa.fa-eye
= paginate @posts